<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <f:view locale="pt_BR" contentType="text/html" encoding="UTF-8" id="principal">
        <h:head>
            <title><ui:insert name="title">Default Title</ui:insert></title>
            <h:outputStylesheet name="css/jsfcrud.css"/>
            <h:outputStylesheet name="css/bootstrap.css"/>
            <h:outputStylesheet name="css/starter-template.css"/>
            <h:outputScript library="js" name="js.js" />
            <h:outputScript library="js" name="bootstrap.js" />

        </h:head>

        <h:body>
            <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
                <div class="container">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="#">Vendas</a>
                    </div>
                    <h:form id="menu">
                        <div class="collapse navbar-collapse">
                            <ul class="nav navbar-nav">
                                <li class="#{view.viewId == '/principal/index.xhtml' ? 'active' : ''}"><a href="#{facesContext.externalContext.requestContextPath}/principal/index.xhtml">Principal</a></li>
                                <li class="#{view.viewId == '/cadastro/categoria/List.xhtml' ? 'active' : ''}"><a href="#{facesContext.externalContext.requestContextPath}/cadastro/categoria/List.xhtml">Categoria</a></li>
                                <li class="#{view.viewId == '/cadastro/produto/List.xhtml' ? 'active' : ''}"><a href="#{facesContext.externalContext.requestContextPath}/cadastro/produto/List.xhtml">Produto</a></li>
                                <li class="#{view.viewId == '/cadastro/cliente/List.xhtml' ? 'active' : ''}"><a href="#{facesContext.externalContext.requestContextPath}/cadastro/cliente/List.xhtml">Cliente</a></li>
                                <li class="#{view.viewId == '/compras/pedido/List.xhtml' ? 'active' : ''}"><a href="#{facesContext.externalContext.requestContextPath}/compras/pedido/List.xhtml">Pedido</a></li>
                                <li><h:commandLink value="Sair" action="#{loginController.sair()}"/></li>
                            </ul>
                        </div><!--/.nav-collapse -->
                    </h:form>
                </div>
            </div>
            <div class="container">
                <div class="starter-template">
                    <p>
                        <h:panelGroup id="messagePanel" layout="block">
                            <p:messages showDetail="false" 
                                        autoUpdate="true" globalOnly="false" showSummary="true" />
                        </h:panelGroup>
                    </p>
                    <p>
                        <ui:insert name="body">Default Body</ui:insert>
                    </p>
                </div>
            </div><!-- /.container -->
        </h:body>
    </f:view>
</html>
